import cgi
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__),"src"));

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from page.index import Index
from page.submit import Submit
from page.account import Account
from page.avatar import Avatar
from page.mailblog import MailBlog
from page.htmlout import HtmlOut
from page.myfavor import MyFavor
from page.zone import Zone
from page.test import Test
template.register_template_library('app.dateformat')

application = webapp.WSGIApplication(
                                     [('/', Index),
                                      ('/submit',Submit),
                                      ('/account',Account),
                                      ('/avatar',Avatar),
                                      ('/html',HtmlOut),
                                      ('/myfavor',MyFavor),
                                      (r'/u/(.*)',Zone),
                                      ('/test',Test)
                                      ],
                                     
                                     debug=True)
def main():
    run_wsgi_app(application)
if __name__ == '__main__':
    main()